package com.sskj.finance.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.finance.bean.FinanInfoBean;
import com.sskj.finance.http.HttpConfig;
import com.sskj.finance.ui.activity.FinanceInfoActivity;
import com.sskj.lib.http.JsonCallBack;

public class FinanceInfoActivityPresenter extends BasePresenter<FinanceInfoActivity>{

    /**
     * 理财产品详情
     *
     * @param id 理财产品id
     * @return
     */
    public void finanInfo(String id){
        httpService.finanInfo( id).execute(new JsonCallBack<HttpData<FinanInfoBean>>(this) {
            @Override
            public void onSuccess(Response<HttpData<FinanInfoBean>> response) {
               HttpData<FinanInfoBean> httpData = response.body();
               if (httpData.getStatus() == HttpConfig.OK) {

                   mView.updateUI(httpData.getData());
               }
            }
        });
    }
}
